package com.vpen.springsecuritytest.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * -@Version 1.0
 * -@Author:Vpen
 * -@Date:2021/3/11 21:34
 * -@Content:
 */
@Configuration
public class MyWebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("index");
        registry.addViewController("/page/page1.html").setViewName("page/page1");
        registry.addViewController("/page/page2.html").setViewName("page/page2");
        registry.addViewController("/page/page3.html").setViewName("page/page3");
        registry.addViewController("/hello.html").setViewName("hello");
        registry.addViewController("/login.html").setViewName("login");
//        registry.addViewController("/toLogin").setViewName("login");
        registry.addViewController("/logout.html").setViewName("logout");
        registry.addViewController("/success.html").setViewName("success");
        registry.addViewController("/error.html").setViewName("403");

    }

}
